package org.dtrevien.metamodel.graphviz.stmt.impl;

import java.util.ArrayList;
import java.util.List;

import javax.sound.sampled.Port;

import org.dtrevien.metamodel.graphviz.AttrList;
import org.dtrevien.metamodel.graphviz.stmt.Stmt;
import org.dtrevien.metamodel.graphviz.visitor.Visitor;

public class NodeStmt extends Stmt {

	protected String name;
	protected Port ports; //Can be null
	protected List<AttrList> attrLists;
	
	/**
	 * Create a node Statement, with slot for attributes (attrLists.get(0)) 
	 * and one more for methods ((attrLists.get(1))
	 */
	public NodeStmt() {
		this.attrLists = new ArrayList<AttrList>();
		AttrList attributes = new AttrList();
		AttrList methods = new AttrList();
		this.attrLists.add(attributes);
		this.attrLists.add(methods);
	}

	public NodeStmt(String name, Port ports, List<AttrList> attrLists) {
		super();
		this.name = name;
		this.ports = ports;
		this.attrLists = attrLists;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Port getPorts() {
		return this.ports;
	}

	public void setPorts(Port ports) {
		this.ports = ports;
	}

	public List<AttrList> getAttrLists() {
		return this.attrLists;
	}

	public void setAttrLists(List<AttrList> attrLists) {
		this.attrLists = attrLists;
	}

	@Override
	public void accept(Visitor v) {
		v.visitNodeStmt(this);
	}
	
}
